import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import redis
import time
import json
rc = redis.Redis(host='192.168.1.101', port=6379,db=7,password='123456')
tag_dict={}
for line in open('new_tag_content.txt'):
        cols = line.strip().split('\t')
        if len(cols) != 2:
            continue
        tag, words = cols
	tag_dict[tag]=words
tag_dict_str=json.dumps(tag_dict)
#print tag_dict_str
#rc.hset('tag_dict', 'tag_dict', tag_dict_str)
print rc.hget('tag_dict', 'tag_dict')


